<h1 style='color:#9999CC;font-size:18px;'><b>.:: <? if($_REQUEST[status]==0){?>รายการสั่งซื้อมาใหม่<?}else{?>รายการสั่งซื้อที่อนุมัติ<?}?> ::.</b></h1><br><br>
<?
$ii=1;
$r1 = Q2("select DISTINCT odn_cartid  from ordernow where odn_status = '".$_REQUEST['status']."' order by odn_id desc ");
foreach($r1 as $r)
{
	$rx = Q1("select * from ordernow where odn_status = '".$_REQUEST['status']."' and odn_cartid='".$r[odn_cartid]."' limit 1");
	$ry = Q1("select * from customer where cust_id = '".$rx[odn_cust]."' ");
?>

<div style="padding:0 0 10px 0;">
<label style="width:40px;display:inline;"><?=$ii?>.</label> 
<a href="?body=orderview&odn_cartid=<?=$r['odn_cartid']?>&status=<?=$_REQUEST['status']?>">
	::::: <?=$r['odn_cartid']?> | <b style='color:green'>[ <?=$rx['date_in']?> ]</b>
	<?if($_REQUEST['status']==1) {?> | <b style='color:blue'>[ <?=$rx[date_accept]?> ]</b><?}?>
	 | <!--<b style='color:red'>[ <?=$ry[cust_email]?> ]</b>-->
</a>
</div>


<?
$ii++;
}
?>